<nav class="breadcrumb is-size-7-mobile is-size-6" aria-label="breadcrumbs">
    <ul>
        <||= if not? all? @[2 = size pagePath "documentation" = first pagePath  "_index" = last pagePath][ ||>
            <li><a href="<||= linkTo {documentation/} ||>" style="margin-left:0">Home</a></li>
        <|| ] ||>
        <||= 
            pathItems: new []
            pathSoFar: new ["documentation"]

            pageRoute: new pagePath 
            if "_index" = last pageRoute -> pageRoute: chop pageRoute
            pageRoute: slice pageRoute 1 (size pageRoute)-1
            loop.with:'pidx pageRoute 'pp [
                'pathSoFar ++ pp
                if? pp=last pageRoute [
                    lastItem: pp 
                    if not? and? [contains? pageRoute "library"]
                                 [and? [0 =< pidx-2]["library"= pageRoute\[pidx-2]]] [
                        lastItem: join.with:" " map split.words lastItem 'x -> capitalize replace x "-" "?"
                    ]
                    'pathItems ++ ~{<li class="is-active"><a href="#">|replace lastItem "-" "?"|</a></li>}
                ] 
                else [
                    'pathItems ++ ~{<li><a href="|linkTo join.path pathSoFar|">|capitalize pp|</a></li>}
                ] 
            ]
            join pathItems
        ||>
    </ul>
</nav>